package com.itheima;

public class Test3 {
    public static void main(String[] args) {
        int[] arr = {11, 22, 33, 44, 55, 66};
        swop(arr, 1, 5);

        // 遍历查看交换后的结果
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + ",");
        }
    }
    public static void swop(int[] arr, int index1, int index2) {
        int temp = arr[index1];
        arr[index1] = arr[index2];
        arr[index2] = temp;
    }
}